<title>All Brands</title>
<div id="view-content">
    <div class="row-fluid">
        <a class="btn btn-success" href="<?= $this->url(array(), 'brand-add'); ?>">Add New</a>
        <div class="well">
            <table class="table">
                <thead>
                    <tr>
                        <td>#</td>
                        <td>Image</td>
                        <td>Name</td>
                        <td>In Menu</td>
                        <td></td>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $i = 1;
                    foreach ($this->allBrands as $brand) {
                        $class= "";
                        if(!$brand->enabled){
                            $class = "alert alert-error";
                        }
                        ?>
                        <tr class="<?=$class?>" >
                            <td><?= $i; ?></td>                            
                            <td><img src="http://<?=$_SERVER['SERVER_NAME']?>/uploads/brands/<?=$brand['image']?>" style="width: 100px;" /></td>
                            <td><?=$brand['name']?></td>
                            <td>
                                <?php
                                $menuDb = new Admin_Model_Menu();
                                $menuById = $menuDb->getMenuById($brand['menu_id']);
                                echo $menuById[0]['name'];
                                ?>
                                
                            </td>
                            <td>
                                <a class="btn btn-success" href="<?=$this->url(array('id'=>$brand['id']),'brand-update');?>"><i class="icon-white icon-edit"></i> Edit</a>
                            </td>
                        </tr>
                        <?php
                        $i++;
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>